package com.community.itelligentcommunity.community.myCommunity.controller;

import com.community.itelligentcommunity.common.base.controller.GenericController;
import com.community.itelligentcommunity.common.base.service.GenericService;
import com.community.itelligentcommunity.community.myCommunity.entity.Information;
import com.community.itelligentcommunity.community.myCommunity.entity.QueryInformation;
import com.community.itelligentcommunity.community.myCommunity.service.InformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;


@Controller
@RequestMapping("/information")
public class InformationController extends GenericController<Information, QueryInformation> {

    @Autowired
    private InformationService informationService;


    @Override
    protected GenericService<Information, QueryInformation> getService() {
        return informationService;
    }

    @Override
    public String addPage() throws Exception {
        return "community/myCommunity/Information/add";
    }


    @Override
    public String updatePage(Information entity, Model model) throws Exception {
        entity = getService().get(entity);
        model.addAttribute("entity",entity);
        return "community/myCommunity/Information/update";
    }

    public  int  aaa(String bb){
        return 1;
    };
}

